

putexcel set "Results\tab_B1\results_table_eq_appendix", replace

putexcel B1 = "N (1,000s)"
putexcel B2 = "1980"
putexcel C2 = "2018"

putexcel D1 = "Sorting"
putexcel D2 = "1980"
putexcel E2 = "2018"
putexcel F2 = "Change"

putexcel G1 = "Gini, data"
putexcel G2 = "1980"
putexcel H2 = "2018"

putexcel I1 = "Gini (i)"
putexcel I2 = "2018"

putexcel J1 = "D Gini (i)/D Gini, data"

*benchmark

putexcel A3 = "Benchmark"

clear
use "Results\fig_B1\results_ambition"

gen temp=male_1_marr+male_2_marr+male_3_marr+male_4_marr+female_1_marr+female_2_marr+female_3_marr+female_4_marr+male_1_sing+male_2_sing+male_3_sing+male_4_sing+female_1_sing+female_2_sing+female_3_sing+female_4_sing

qui sum temp if aar==1980
sca temp2=r(mean)/1000

putexcel B3 = temp2

qui sum temp if aar==2018
sca temp2=r(mean)/1000

putexcel C3 = temp2

drop temp

gen temp=s_1_1*(0*male_1+(1-0)*female_1)+s_2_2*(0*male_2+(1-0)*female_2)+s_3_3*(0*male_3+(1-0)*female_3)+s_4_4*(0*male_4+(1-0)*female_4)

qui sum temp if aar==1980
sca temp2=r(mean)

putexcel D3 = temp2

qui sum temp if aar==2018
sca temp3=r(mean)

putexcel E3 = temp3

sca temp4=(temp3-temp2)/temp2

putexcel F3 = temp4

drop temp

clear
use "Results\fig_3\results"

qui sum gini if aar==1980
sca temp2=r(mean)

putexcel G3 = temp2

qui sum gini if aar==2018
sca temp3=r(mean)

putexcel H3 = temp3

qui sum gini_cf_sort if aar==2018
sca temp4=r(mean)

putexcel I3 = temp4

sca temp5=(temp4-temp2)/(temp3-temp2)

putexcel J3 = temp5


*ambition_shrt_irreg_50 - PRIMEAGE

putexcel A4 = "hours-based types"

clear
use "Results\tab_B1\Scenario_1\Sorting\results_ambition_fig_3_primeage_long.dta"

gen temp=male_1_marr+male_2_marr+male_3_marr+male_4_marr+female_1_marr+female_2_marr+female_3_marr+female_4_marr+male_1_sing+male_2_sing+male_3_sing+male_4_sing+female_1_sing+female_2_sing+female_3_sing+female_4_sing

qui sum temp if aar==1980
sca temp2=r(mean)/1000

putexcel B4 = temp2

qui sum temp if aar==2018
sca temp2=r(mean)/1000

putexcel C4 = temp2

drop temp

gen temp=s_1_1*(0*male_1+(1-0)*female_1)+s_2_2*(0*male_2+(1-0)*female_2)+s_3_3*(0*male_3+(1-0)*female_3)+s_4_4*(0*male_4+(1-0)*female_4)

qui sum temp if aar==1980
sca temp2=r(mean)

putexcel D4 = temp2

qui sum temp if aar==2018
sca temp3=r(mean)

putexcel E4 = temp3

sca temp4=(temp3-temp2)/temp2

putexcel F4 = temp4

drop temp

clear

use "Results\tab_B1\Scenario_1\Decomposition\results_eq_fig_4_primeage_long.dta"

qui sum gini if aar==1980
sca temp2=r(mean)

putexcel G4 = temp2

qui sum gini if aar==2018
sca temp3=r(mean)

putexcel H4 = temp3

qui sum gini_cf_sort if aar==2018
sca temp4=r(mean)

putexcel I4 = temp4

sca temp5=(temp4-temp2)/(temp3-temp2)

putexcel J4 = temp5


*ambition_shrt_irreg_50 - PRIMEAGE - BENCHMARK

putexcel A5 = "benchmark (hours sample)"

clear
use "Results\tab_B1\Scenario_2\Sorting\results_ambition_fig_3_primeage_long_baseline.dta"

gen temp=male_1_marr+male_2_marr+male_3_marr+male_4_marr+female_1_marr+female_2_marr+female_3_marr+female_4_marr+male_1_sing+male_2_sing+male_3_sing+male_4_sing+female_1_sing+female_2_sing+female_3_sing+female_4_sing

qui sum temp if aar==1980
sca temp2=r(mean)/1000

putexcel B5 = temp2

qui sum temp if aar==2018
sca temp2=r(mean)/1000

putexcel C5 = temp2

drop temp

gen temp=s_1_1*(0*male_1+(1-0)*female_1)+s_2_2*(0*male_2+(1-0)*female_2)+s_3_3*(0*male_3+(1-0)*female_3)+s_4_4*(0*male_4+(1-0)*female_4)

qui sum temp if aar==1980
sca temp2=r(mean)

putexcel D5 = temp2

qui sum temp if aar==2018
sca temp3=r(mean)

putexcel E5 = temp3

sca temp4=(temp3-temp2)/temp2

putexcel F5 = temp4

drop temp

clear

use "Results\tab_B1\Scenario_2\Decomposition\results_eq_fig_4_primeage_long_baseline.dta"

qui sum gini if aar==1980
sca temp2=r(mean)

putexcel G5 = temp2

qui sum gini if aar==2018
sca temp3=r(mean)

putexcel H5 = temp3

qui sum gini_cf_sort if aar==2018
sca temp4=r(mean)

putexcel I5 = temp4

sca temp5=(temp4-temp2)/(temp3-temp2)

putexcel J5 = temp5



* lifetime earnings 1990-2010

putexcel A6 = "lifetime-earnings types"

clear
use "Results\tab_B1\Scenario_3\Sorting\results_lifetime_19902010.dta"

gen temp=male_1_marr+male_2_marr+male_3_marr+male_4_marr+female_1_marr+female_2_marr+female_3_marr+female_4_marr+male_1_sing+male_2_sing+male_3_sing+male_4_sing+female_1_sing+female_2_sing+female_3_sing+female_4_sing

qui sum temp if aar==1990
sca temp2=r(mean)/1000

putexcel B6 = temp2

qui sum temp if aar==2010
sca temp2=r(mean)/1000

putexcel C6 = temp2

drop temp

gen temp=s_1_1*(0*male_1+(1-0)*female_1)+s_2_2*(0*male_2+(1-0)*female_2)+s_3_3*(0*male_3+(1-0)*female_3)+s_4_4*(0*male_4+(1-0)*female_4)

qui sum temp if aar==1990
sca temp2=r(mean)

putexcel D6 = temp2

qui sum temp if aar==2010
sca temp3=r(mean)

putexcel E6 = temp3

sca temp4=(temp3-temp2)/temp2

putexcel F6 = temp4

drop temp

clear

use "Results\tab_B1\Scenario_3\Decomposition\results_lifetime_19902010_eq.dta"

qui sum gini if aar==1990
sca temp2=r(mean)

putexcel G6 = temp2

qui sum gini if aar==2010
sca temp3=r(mean)

putexcel H6 = temp3

qui sum gini_cf_sort if aar==2010
sca temp4=r(mean)

putexcel I6 = temp4

sca temp5=(temp4-temp2)/(temp3-temp2)

putexcel J6 = temp5


* BENCHMARK (lifetime earnings sample)

putexcel A7 = "benchmark (LE sample)"

clear
use "Results\tab_B1\Scenario_4\Sorting\results_ambition_19902010.dta"

gen temp=male_1_marr+male_2_marr+male_3_marr+male_4_marr+female_1_marr+female_2_marr+female_3_marr+female_4_marr+male_1_sing+male_2_sing+male_3_sing+male_4_sing+female_1_sing+female_2_sing+female_3_sing+female_4_sing

qui sum temp if aar==1990
sca temp2=r(mean)/1000

putexcel B7 = temp2

qui sum temp if aar==2010
sca temp2=r(mean)/1000

putexcel C7 = temp2

drop temp

gen temp=s_1_1*(0*male_1+(1-0)*female_1)+s_2_2*(0*male_2+(1-0)*female_2)+s_3_3*(0*male_3+(1-0)*female_3)+s_4_4*(0*male_4+(1-0)*female_4)

qui sum temp if aar==1990
sca temp2=r(mean)

putexcel D7 = temp2

qui sum temp if aar==2010
sca temp3=r(mean)

putexcel E7 = temp3

sca temp4=(temp3-temp2)/temp2

putexcel F7 = temp4

drop temp

clear


use "Results\tab_B1\Scenario_4\Decomposition\results_ambition_19902010_eq.dta"

qui sum gini if aar==1990
sca temp2=r(mean)

putexcel G7 = temp2

qui sum gini if aar==2010
sca temp3=r(mean)

putexcel H7 = temp3

qui sum gini_cf_sort if aar==2010
sca temp4=r(mean)

putexcel I7 = temp4

sca temp5=(temp4-temp2)/(temp3-temp2)

putexcel J7 = temp5



